﻿using ApiGateway;
using HttpApiGateway;
using HttpApiGateway.Model;
using RpcClient;
using Wedonek.RpcStore.Gateway.Interface;
using Wedonek.RpcStore.Gateway.Model;
using Wedonek.RpcStore.Service.Model;

namespace Wedonek.RpcStore.Gateway.Controller
{
    /// <summary>
    /// 数据链路
    /// </summary>
    internal class TraceController : ApiController
    {
        private readonly IRpcTraceService _Service;
        public TraceController(IRpcTraceService service)
        {
            this._Service = service;
        }
        /// <summary>
        /// 查询数据链路
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public PagingResult<RpcTraceData> Query(PagingParam<TraceQueryParam> query)
        {
            RpcTraceData[] list = this._Service.Query(query.Param, query.ToBasicPaging(), out long count);
            return new PagingResult<RpcTraceData>(list, count);
        }
    }
}
